// ==UserScript==
// @name         Scratch全屏阻止滚轮
// @namespace    https://gitee.com/Zeng_YL
// @source       https://gitee.com/Zeng_YL/scratch_addon/tree/master/Scratch全屏阻止滚轮
// @updateURL    https://gitee.com/Zeng_YL/scratch_addon/raw/master/Scratch全屏阻止滚轮/userscript.user.js
// @version      0.1
// @description  为Scratch网站添加全屏时阻止滚轮的功能。适配A营、卡搭、共创。官网有多语言，懒得适配了。
// @author       zengyl
// @match        https://*.gitblock.cn/*
// @match        https://*.kada.163.com/*
// @match        https://*.aerfaying.com/*
// @match        https://*.ccw.site/*
// @license      MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var button;
    if(window.location.href.search("kada.163.com") != -1) {
        button = "stage-header_stage-button-icon_3zzFK";
    }else if(window.location.href.search(/(gitblock.cn)|(aerfaying.com)/) != -1) {
        button = "stage-header_stage-button-icon_1SHv0";
    }else if(window.location.href.search("ccw.site") != -1) {
        button = "stage-header_stage-button-icon_3zzFK";
    }

    var scrollFunction = function(e) {
        if(document.getElementsByClassName(button).length > 0) {
            if(document.getElementsByClassName(button)[0].alt == "退出全屏模式"){
                e = e || window.event;
                e.preventDefault && e.preventDefault();
            }
        }
    }
    if (document.addEventListener) {
        document.addEventListener('DOMMouseScroll', scrollFunction, false);
    }
    window.addEventListener('mousewheel', scrollFunction, {
        passive: false
    });

})();